% Intrinsic and Extrinsic Camera Parameters
%
% This script file can be directly executed under Matlab to recover the camera intrinsic and extrinsic parameters.
% IMPORTANT: This file contains neither the structure of the calibration objects nor the image coordinates of the calibration points.
%            All those complementary variables are saved in the complete matlab data file Calib_Results.mat.
% For more information regarding the calibration model visit http://www.vision.caltech.edu/bouguetj/calib_doc/


%-- Focal length:
fc = [ 1307.163287602926900 ; 1316.030861995529700 ];

%-- Principal point:
cc = [ 307.206632578773340 ; 183.511818928674100 ];

%-- Skew coefficient:
alpha_c = 0.000000000000000;

%-- Distortion coefficients:
kc = [ -0.072613202577991 ; 1.603727217234501 ; -0.001081335657011 ; -0.000860647763416 ; 0.000000000000000 ];

%-- Focal length uncertainty:
fc_error = [ 15.884054277521761 ; 16.373832845314251 ];

%-- Principal point uncertainty:
cc_error = [ 7.891819763183920 ; 9.193358753401338 ];

%-- Skew coefficient uncertainty:
alpha_c_error = 0.000000000000000;

%-- Distortion coefficients uncertainty:
kc_error = [ 0.038879244009078 ; 0.489546106023320 ; 0.004043827400663 ; 0.002001135379167 ; 0.000000000000000 ];

%-- Image size:
nx = 640;
ny = 480;


%-- Various other variables (may be ignored if you do not use the Matlab Calibration Toolbox):
%-- Those variables are used to control which intrinsic parameters should be optimized

n_ima = 20;						% Number of calibration images
est_fc = [ 1 ; 1 ];					% Estimation indicator of the two focal variables
est_aspect_ratio = 1;				% Estimation indicator of the aspect ratio fc(2)/fc(1)
center_optim = 1;					% Estimation indicator of the principal point
est_alpha = 0;						% Estimation indicator of the skew coefficient
est_dist = [ 1 ; 1 ; 1 ; 1 ; 0 ];	% Estimation indicator of the distortion coefficients


%-- Extrinsic parameters:
%-- The rotation (omc_kk) and the translation (Tc_kk) vectors for every calibration image and their uncertainties

%-- Image #1:
omc_1 = [ 2.102917e+00 ; 2.152124e+00 ; -1.586012e-01 ];
Tc_1  = [ -9.966175e+01 ; 1.625051e+02 ; 2.520879e+03 ];
omc_error_1 = [ 7.846301e-03 ; 7.504479e-03 ; 1.650471e-02 ];
Tc_error_1  = [ 1.526122e+01 ; 1.758623e+01 ; 3.022757e+01 ];

%-- Image #2:
omc_2 = [ 2.089407e+00 ; 2.140290e+00 ; -1.783561e-01 ];
Tc_2  = [ -1.029957e+02 ; 1.629425e+02 ; 2.473600e+03 ];
omc_error_2 = [ 7.028173e-03 ; 6.804931e-03 ; 1.456278e-02 ];
Tc_error_2  = [ 1.497427e+01 ; 1.725823e+01 ; 2.963760e+01 ];

%-- Image #3:
omc_3 = [ -2.096579e+00 ; -2.145185e+00 ; -1.995682e-01 ];
Tc_3  = [ -1.031729e+02 ; 1.658761e+02 ; 2.386868e+03 ];
omc_error_3 = [ 4.630735e-03 ; 6.179256e-03 ; 1.070855e-02 ];
Tc_error_3  = [ 1.443906e+01 ; 1.668840e+01 ; 2.917798e+01 ];

%-- Image #4:
omc_4 = [ NaN ; NaN ; NaN ];
Tc_4  = [ NaN ; NaN ; NaN ];
omc_error_4 = [ NaN ; NaN ; NaN ];
Tc_error_4  = [ NaN ; NaN ; NaN ];

%-- Image #5:
omc_5 = [ -2.021834e+00 ; -2.132930e+00 ; 5.834408e-01 ];
Tc_5  = [ -5.132194e+01 ; 1.645324e+02 ; 2.512592e+03 ];
omc_error_5 = [ 5.457027e-03 ; 4.316090e-03 ; 9.237715e-03 ];
Tc_error_5  = [ 1.518160e+01 ; 1.751672e+01 ; 2.943820e+01 ];

%-- Image #6:
omc_6 = [ -2.031215e+00 ; -2.138522e+00 ; 5.829810e-01 ];
Tc_6  = [ -4.123622e+01 ; 1.644919e+02 ; 2.561655e+03 ];
omc_error_6 = [ 5.453272e-03 ; 4.308068e-03 ; 9.275339e-03 ];
Tc_error_6  = [ 1.547746e+01 ; 1.785905e+01 ; 3.003867e+01 ];

%-- Image #7:
omc_7 = [ 2.156812e+00 ; 2.233249e+00 ; -3.593912e-01 ];
Tc_7  = [ -1.705079e+02 ; 1.589022e+02 ; 2.098676e+03 ];
omc_error_7 = [ 5.216355e-03 ; 6.228927e-03 ; 1.056613e-02 ];
Tc_error_7  = [ 1.269506e+01 ; 1.467095e+01 ; 2.504922e+01 ];

%-- Image #8:
omc_8 = [ 2.035856e+00 ; 2.052791e+00 ; -5.712562e-03 ];
Tc_8  = [ -2.078248e+02 ; 1.611695e+02 ; 2.390500e+03 ];
omc_error_8 = [ 5.359024e-03 ; 4.864022e-03 ; 1.127311e-02 ];
Tc_error_8  = [ 1.449646e+01 ; 1.672434e+01 ; 2.906045e+01 ];

%-- Image #9:
omc_9 = [ 2.061627e+00 ; 2.089676e+00 ; -7.629597e-02 ];
Tc_9  = [ -1.958539e+02 ; 1.590113e+02 ; 2.127076e+03 ];
omc_error_9 = [ 5.506910e-03 ; 5.218260e-03 ; 1.228616e-02 ];
Tc_error_9  = [ 1.290768e+01 ; 1.488350e+01 ; 2.579325e+01 ];

%-- Image #10:
omc_10 = [ 2.061023e+00 ; 2.088818e+00 ; -7.800462e-02 ];
Tc_10  = [ -1.958800e+02 ; 1.590326e+02 ; 2.127155e+03 ];
omc_error_10 = [ 5.491879e-03 ; 5.210129e-03 ; 1.224895e-02 ];
Tc_error_10  = [ 1.290824e+01 ; 1.488421e+01 ; 2.579182e+01 ];

%-- Image #11:
omc_11 = [ -2.039605e+00 ; -2.052341e+00 ; -4.155299e-02 ];
Tc_11  = [ -1.844704e+02 ; 1.614436e+02 ; 2.008436e+03 ];
omc_error_11 = [ 4.916360e-03 ; 5.584507e-03 ; 9.638226e-03 ];
Tc_error_11  = [ 1.217220e+01 ; 1.406704e+01 ; 2.446389e+01 ];

%-- Image #12:
omc_12 = [ -2.009267e+00 ; -2.003137e+00 ; 4.529740e-02 ];
Tc_12  = [ -6.393891e+01 ; 1.661243e+02 ; 2.331751e+03 ];
omc_error_12 = [ 4.884851e-03 ; 5.446071e-03 ; 9.302878e-03 ];
Tc_error_12  = [ 1.411031e+01 ; 1.627663e+01 ; 2.802954e+01 ];

%-- Image #13:
omc_13 = [ -2.135214e+00 ; -2.215938e+00 ; 3.936342e-01 ];
Tc_13  = [ -2.512250e+01 ; 1.635109e+02 ; 2.460038e+03 ];
omc_error_13 = [ 5.472871e-03 ; 5.387181e-03 ; 1.069946e-02 ];
Tc_error_13  = [ 1.486383e+01 ; 1.715598e+01 ; 2.919460e+01 ];

%-- Image #14:
omc_14 = [ 2.039695e+00 ; 2.059183e+00 ; 2.613677e-02 ];
Tc_14  = [ -2.318808e+02 ; 1.595565e+02 ; 2.387110e+03 ];
omc_error_14 = [ 5.436976e-03 ; 4.909816e-03 ; 1.132983e-02 ];
Tc_error_14  = [ 1.448269e+01 ; 1.671174e+01 ; 2.912586e+01 ];

%-- Image #15:
omc_15 = [ 2.034096e+00 ; 2.050043e+00 ; 2.125661e-04 ];
Tc_15  = [ -2.409579e+02 ; 1.598717e+02 ; 2.338149e+03 ];
omc_error_15 = [ 5.304472e-03 ; 4.889480e-03 ; 1.111079e-02 ];
Tc_error_15  = [ 1.419505e+01 ; 1.637811e+01 ; 2.852860e+01 ];

%-- Image #16:
omc_16 = [ -2.149375e+00 ; -2.237499e+00 ; -4.028357e-01 ];
Tc_16  = [ -2.254473e+02 ; 1.629846e+02 ; 2.249917e+03 ];
omc_error_16 = [ 4.087144e-03 ; 6.178929e-03 ; 1.076247e-02 ];
Tc_error_16  = [ 1.359549e+01 ; 1.577165e+01 ; 2.815681e+01 ];

%-- Image #17:
omc_17 = [ -2.038551e+00 ; -2.049384e+00 ; -3.274026e-02 ];
Tc_17  = [ -6.554621e+01 ; 1.644227e+02 ; 2.163073e+03 ];
omc_error_17 = [ 4.700848e-03 ; 5.624390e-03 ; 9.530313e-03 ];
Tc_error_17  = [ 1.309509e+01 ; 1.511242e+01 ; 2.618779e+01 ];

%-- Image #18:
omc_18 = [ 2.155176e+00 ; 2.232829e+00 ; -3.602176e-01 ];
Tc_18  = [ -5.137281e+01 ; 1.621955e+02 ; 2.253324e+03 ];
omc_error_18 = [ 5.713375e-03 ; 6.069109e-03 ; 1.083389e-02 ];
Tc_error_18  = [ 1.361546e+01 ; 1.571723e+01 ; 2.682218e+01 ];

%-- Image #19:
omc_19 = [ 2.163199e+00 ; 2.230331e+00 ; -3.243603e-01 ];
Tc_19  = [ -4.003505e+01 ; 1.619760e+02 ; 2.295454e+03 ];
omc_error_19 = [ 6.364900e-03 ; 6.364573e-03 ; 1.189070e-02 ];
Tc_error_19  = [ 1.387004e+01 ; 1.600889e+01 ; 2.738621e+01 ];

%-- Image #20:
omc_20 = [ 2.030706e+00 ; 2.041493e+00 ; 4.059741e-02 ];
Tc_20  = [ -3.302846e+02 ; 1.560845e+02 ; 2.148813e+03 ];
omc_error_20 = [ 5.266882e-03 ; 5.019551e-03 ; 1.066591e-02 ];
Tc_error_20  = [ 1.310643e+01 ; 1.512125e+01 ; 2.660359e+01 ];

